#include <stdio.h>
#include <src/Vector.h>
#include <src/List.h>

#define randomAccessIterators(_Feature) \
    VectorIterator: vectorIterator##_Feature

#define bidirectionalIterators(_Feature) \
    ListIterator: listIterator##_Feature

#include <src/template.h>

int main(int argc, char *argv[]) {
	printf("[INF] (%s, %d) %s\n", __FILE__, __LINE__, "Vector");
	Vector vector;
	vectorConstruct(&vector);
	for (int i = 0; i < 10; ++i) {
		vectorInsert(&vector, vectorEnd(&vector), i);
	}
	for (VectorIterator vectorIterator = vectorBegin(&vector), end = vectorEnd(&vector); iteratorNotEqualTo(&vectorIterator, &end); iteratorIncreasePrefix(&vectorIterator)) {
		printf("[INF] (%s, %d) %d\n", __FILE__, __LINE__, *iteratorIndirect(&vectorIterator));
	}
	for (int i = 0; i < 10; ++i) {
		VectorIterator vectorIterator = vectorBegin(&vector);
		printf("[INF] (%s, %d) %d\n", __FILE__, __LINE__, *iteratorSubscript(&vectorIterator, i));
	}
	vectorDestruct(&vector);

	printf("[INF] (%s, %d) %s\n", __FILE__, __LINE__, "List");
	List list;
	listConstruct(&list);
	for (int i = 0; i < 10; ++i) {
		listInsert(listEnd(&list), i);
	}
	for (ListIterator listIterator = listBegin(&list), end = listEnd(&list); iteratorNotEqualTo(&listIterator, &end); iteratorIncreasePrefix(&listIterator)) {
		printf("[INF] (%s, %d) %d\n", __FILE__, __LINE__, *iteratorIndirect(&listIterator));
	}
	listDestruct(&list);
}
